<?php

/**
 * Http Api 接口相应
 * @param $data
 * @param \Swoft\Http\Message\ContentType $contentType
 * @return \Swoft\Http\Message\Response|\Swoft\Rpc\Server\Response|\Swoft\Task\Response
 */
function httpApiResponse ($data, \Swoft\Http\Message\ContentType $contentType) {
    return context()->getResponse()->withContentType($contentType)->withData($data);
}
